package com.jssj.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jssj.service.JssjService;
import com.jssj.util.BaseController;

@Controller
public class JsslController extends BaseController {
	@Autowired
	private JssjService jssjService;
	@ResponseBody
	@RequestMapping("/findByTime")
	public Map<String, Object> findByTime(@RequestParam(value="startTime", required=false) String startTime,
			@RequestParam(value="endTime", required=false) String endTime) {
		return createMap(this.jssjService.findByTime(startTime, endTime));
	}
	@ResponseBody
	@RequestMapping("/findByScore")
	public Map<String, Object> findByScore(@RequestParam(value="score", required=false) String score) {
		return createMap(this.jssjService.findByScore(score));
	}
	@ResponseBody
	@RequestMapping("/findBySchool")
	public Map<String, Object> findBySchool(@RequestParam(value="school", required=false) String school) {
		return createMap(this.jssjService.findBySchool(school));
	}
	@ResponseBody
	@RequestMapping("/findByAddress")
	public Map<String, Object> findByAddress(@RequestParam(value="address", required=false) String address) {
		return createMap(this.jssjService.findByAddress(address));
	}
	@ResponseBody
	@RequestMapping("/findByCondition")
	public Map<String, Object> findByCondition(@RequestParam(value="score", required=false) String score,
			@RequestParam(value="address", required=false) String address,
			@RequestParam(value="professional", required=false) String professional,
			@RequestParam(value="provinces", required=false) String provinces) {
		return createMap(this.jssjService.findByCondition(score, address, professional, provinces));
	}
}
